<h1><?php __('Artigos para Avaliação'); ?></h1>
<h2><?php echo $congress['Congress']['name'] ?></h2>
<h3>Data limite para avaliação: <?php echo date('d/m/Y', strtotime($congress['Congress']['deadline_evaluation'])) ?></h3>

<table cellpadding="0" cellspacing="0">
    <tr>
        <th><?php echo $paginator->sort('Id', 'id'); ?></th>
        <th width="45%"><?php echo $paginator->sort('Artigo', 'Article.name'); ?></th>
        <th><?php __('Média Parcial'); ?></th>
        <th><?php __('Status'); ?></th>
        <th class="actions" colspan="3" style="text-align: center;"><?php __('Ações'); ?></th>
    </tr>
    <?php if (!empty($articles)): ?>
    <?php foreach ($articles as $article): ?>
            <tr>
                <td><?php echo $article['Article']['id'] ?></td>
                <td><?php echo $this->Html->image('pdf_icon.png') . ' ' . $this->Html->link(__($article['Article']['name'], true), $article['Article']['file_path']); ?></td>
                <td><?php echo $article['Evaluation']['mean_grade']; ?></td>
                <td><?php echo $article['Evaluation']['status']; ?></td>
                <td class="actions">
            <?php echo $html->link(__('Avaliar', true), array('evaluator' => true, 'controller' => 'evaluations', 'action' => 'evaluate', $article['Article']['congress_id'], $article['Evaluation']['article_id'])); ?>
        </td>
        <td class="actions">
            <?php echo $html->link(__('Ver Avaliação', true), array('evaluator' => true, 'controller' => 'evaluations', 'action' => 'evaluate', $article['Article']['congress_id'], $article['Evaluation']['article_id'])); ?>
        </td>
        <?php if ($article['Evaluation']['status'] <> 'AV'): ?>
                <td class="actions">
            <?php echo $html->link(__('Finalizar Avaliação', true), array('evaluator' => true, 'controller' => 'evaluations', 'action' => 'endevaluation', $article['Article']['congress_id'], $article['Evaluation']['article_id']), null, sprintf(__('Você está certo em finalizar a avaliação do artigo # %s?', true), $article['Article']['name'])); ?>
            </td>
        <?php else: ?>
                    <td>Avaliação Finalizada</td>
        <?php endif; ?>
                </tr>
    <?php endforeach; ?>
    <?php else: ?>
                        <tr><td colspan="11">Não há artigos para sua avaliação neste congresso.</td></tr>
    <?php endif; ?>
</table>
